g_unsetenv ("DISPLAY");
- g_assert (!gtk_init_check ());
+ g_assert_false (gtk_init_check ());
manager = gdk_display_manager_get ();
- g_assert (manager != NULL);
- g_assert (gdk_display_manager_get_default_display (manager) == NULL);
+ g_assert_nonnull (manager);
+ g_assert_null (gdk_display_manager_get_default_display (manager));
}
static void
g_setenv ("DISPLAY", "poo", TRUE);
- g_assert (!gtk_init_check ());
+ g_assert_false (gtk_init_check ());
manager = gdk_display_manager_get ();
- g_assert (manager != NULL);
- g_assert (gdk_display_manager_get_default_display (manager) == NULL);
+ g_assert_nonnull (manager);
+ g_assert_null (gdk_display_manager_get_default_display (manager));
}
static void
gboolean res;
res = gdk_rgba_parse (&color, "foo");
- g_assert (!res);
+ g_assert_true (!res);
res = gdk_rgba_parse (&color, "");
- g_assert (!res);
+ g_assert_true (!res);
expected.red = 100/255.;
expected.green = 90/255.;
expected.blue = 80/255.;
expected.alpha = 0.1;
res = gdk_rgba_parse (&color, "rgba(100,90,80,0.1)");
- g_assert (res);
- g_assert (gdk_rgba_equal (&color, &expected));
+ g_assert_true (res);
+ g_assert_true (gdk_rgba_equal (&color, &expected));
expected.red = 0.4;
expected.green = 0.3;
expected.blue = 0.2;
expected.alpha = 0.1;
res = gdk_rgba_parse (&color, "rgba(40%,30%,20%,0.1)");
- g_assert (res);
- g_assert (gdk_rgba_equal (&color, &expected));
+ g_assert_true (res);
+ g_assert_true (gdk_rgba_equal (&color, &expected));
res = gdk_rgba_parse (&color, "rgba( 40 % , 30 % , 20 % , 0.1 )");
- g_assert (res);
- g_assert (gdk_rgba_equal (&color, &expected));
+ g_assert_true (res);
+ g_assert_true (gdk_rgba_equal (&color, &expected));
expected.red = 1.0;
expected.green = 0.0;
expected.blue = 0.0;
expected.alpha = 1.0;
res = gdk_rgba_parse (&color, "red");
- g_assert (res);
- g_assert (gdk_rgba_equal (&color, &expected));
+ g_assert_true (res);
+ g_assert_true (gdk_rgba_equal (&color, &expected));
expected.red = 0.0;
expected.green = 0x8080 / 65535.;
expected.blue = 1.0;
expected.alpha = 1.0;
res = gdk_rgba_parse (&color, "#0080ff");
- g_assert (res);
- g_assert (gdk_rgba_equal (&color, &expected));
+ g_assert_true (res);
+ g_assert_true (gdk_rgba_equal (&color, &expected));
expected.red = 0.0;
expected.green = 0.0;
expected.blue = 0.0;
expected.alpha = 1.0;
res = gdk_rgba_parse (&color, "rgb(0,0,0)");
- g_assert (res);
- g_assert (gdk_rgba_equal (&color, &expected));
+ g_assert_true (res);
+ g_assert_true (gdk_rgba_equal (&color, &expected));
expected.red = 0.0;
expected.green = 0x8080 / 65535.;
expected.blue = 1.0;
expected.alpha = 0x8888 / 65535.;
res = gdk_rgba_parse (&color, "#0080ff88");
- g_assert (res);
- g_assert (gdk_rgba_equal (&color, &expected));
+ g_assert_true (res);
+ g_assert_true (gdk_rgba_equal (&color, &expected));
}
static void
orig = g_strdup (setlocale (LC_ALL, NULL));
res = gdk_rgba_to_string (&rgba);
gdk_rgba_parse (&out, res);
- g_assert (gdk_rgba_equal (&rgba, &out));
+ g_assert_true (gdk_rgba_equal (&rgba, &out));
setlocale (LC_ALL, "de_DE.utf-8");
res_de = gdk_rgba_to_string (&rgba);
rgba.alpha = 0.9;
out = gdk_rgba_copy (&rgba);
- g_assert (gdk_rgba_equal (&rgba, out));
+ g_assert_true (gdk_rgba_equal (&rgba, out));
gdk_rgba_free (out);
}
/*http://bugzilla.gnome.org/show_bug.cgi?id=667485 */
res = gdk_rgba_parse (&color, "rgb(,,)");
- g_assert (!res);
+ g_assert_false (res);
res = gdk_rgba_parse (&color, "rgb(%,%,%)");
- g_assert (!res);
+ g_assert_false (res);
res = gdk_rgba_parse (&color, "rgb(nan,nan,nan)");
- g_assert (!res);
+ g_assert_false (res);
res = gdk_rgba_parse (&color, "rgb(inf,inf,inf)");
- g_assert (!res);
+ g_assert_false (res);
res = gdk_rgba_parse (&color, "rgb(1p12,0,0)");
- g_assert (!res);
+ g_assert_false (res);
res = gdk_rgba_parse (&color, "rgb(5d1%,1,1)");
- g_assert (!res);
+ g_assert_false (res);
res = gdk_rgba_parse (&color, "rgb(0,0,0)moo");
- g_assert (!res);
+ g_assert_false (res);
res = gdk_rgba_parse (&color, "rgb(0,0,0) moo");
- g_assert (!res);
+ g_assert_false (res);
}
int